package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * QualityInspection generated by hbm2java
 */
@Entity
@Table(name = "quality_inspection")
public class QualityInspection implements java.io.Serializable {

	private Long id;
	private UserBaseInfo userBaseInfo;
	private WorkOrder workOrder;
	private String qualityName;
	private Date createDate;
	private Set<QualityPerson> qualityPersons = new HashSet<QualityPerson>(0);
	private Set<TrainPlan> trainPlans = new HashSet<TrainPlan>(0);

	public QualityInspection() {
	}

	public QualityInspection(UserBaseInfo userBaseInfo, WorkOrder workOrder,
			String qualityName, Date createDate,
			Set<QualityPerson> qualityPersons, Set<TrainPlan> trainPlans) {
		this.userBaseInfo = userBaseInfo;
		this.workOrder = workOrder;
		this.qualityName = qualityName;
		this.createDate = createDate;
		this.qualityPersons = qualityPersons;
		this.trainPlans = trainPlans;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public UserBaseInfo getUserBaseInfo() {
		return this.userBaseInfo;
	}

	public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
		this.userBaseInfo = userBaseInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "WORK_ID")
	public WorkOrder getWorkOrder() {
		return this.workOrder;
	}

	public void setWorkOrder(WorkOrder workOrder) {
		this.workOrder = workOrder;
	}

	@Column(name = "QUALITY_NAME", length = 50)
	public String getQualityName() {
		return this.qualityName;
	}

	public void setQualityName(String qualityName) {
		this.qualityName = qualityName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATE", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "qualityInspection")
	public Set<QualityPerson> getQualityPersons() {
		return this.qualityPersons;
	}

	public void setQualityPersons(Set<QualityPerson> qualityPersons) {
		this.qualityPersons = qualityPersons;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "qualityInspection")
	public Set<TrainPlan> getTrainPlans() {
		return this.trainPlans;
	}

	public void setTrainPlans(Set<TrainPlan> trainPlans) {
		this.trainPlans = trainPlans;
	}

}
